home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / QuickTime / QuickTime 3 Interfaces & Libs / QTDevMac / CIncludes / Menus.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-21  |  21.1 KB  |  681 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Menus.h
  3.  
  4.      Contains:    Menu Manager Interfaces.
  5.  
  6.      Version:    Technology:    Mac OS 8.1
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1985-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __MENUS__
  19. #define __MENUS__
  20.  
  21. #ifndef __APPLEEVENTS__
  22. #include <AppleEvents.h>
  23. #endif
  24. #ifndef __CONDITIONALMACROS__
  25. #include <ConditionalMacros.h>
  26. #endif
  27. #ifndef __EVENTS__
  28. #include <Events.h>
  29. #endif
  30. #ifndef __PROCESSES__
  31. #include <Processes.h>
  32. #endif
  33. #ifndef __TEXTCOMMON__
  34. #include <TextCommon.h>
  35. #endif
  36. #ifndef __MACTYPES__
  37. #include <MacTypes.h>
  38. #endif
  39. #ifndef __QUICKDRAW__
  40. #include <Quickdraw.h>
  41. #endif
  42.  
  43.  
  44.  
  45. #if PRAGMA_ONCE
  46. #pragma once
  47. #endif
  48.  
  49. #ifdef __cplusplus
  50. extern "C" {
  51. #endif
  52.  
  53. #if PRAGMA_IMPORT
  54. #pragma import on
  55. #endif
  56.  
  57. #if PRAGMA_STRUCT_ALIGN
  58.     #pragma options align=mac68k
  59. #elif PRAGMA_STRUCT_PACKPUSH
  60.     #pragma pack(push, 2)
  61. #elif PRAGMA_STRUCT_PACK
  62.     #pragma pack(2)
  63. #endif
  64.  
  65. /*——————————————————————————————————————————————————————————————————————————————————————*/
  66. /*    • Menu Types (for Appearance 1.0 and later)                                            */
  67. /*——————————————————————————————————————————————————————————————————————————————————————*/
  68.  
  69. enum {
  70.     kMenuStdMenuProc            = 63,
  71.     kMenuStdMenuBarProc            = 63
  72. };
  73.  
  74.  
  75. enum {
  76.     kMenuNoModifiers            = 0,                            /* Mask for no modifiers*/
  77.     kMenuShiftModifier            = (1 << 0),                        /* Mask for shift key modifier*/
  78.     kMenuOptionModifier            = (1 << 1),                        /* Mask for option key modifier*/
  79.     kMenuControlModifier        = (1 << 2),                        /* Mask for control key modifier*/
  80.     kMenuNoCommandModifier        = (1 << 3)                        /* Mask for no command key modifier*/
  81. };
  82.  
  83.  
  84. enum {
  85.     kMenuNoIcon                    = 0,                            /* No icon*/
  86.     kMenuIconType                = 1,                            /* Type for ICON*/
  87.     kMenuShrinkIconType            = 2,                            /* Type for ICON plotted 16 x 16*/
  88.     kMenuSmallIconType            = 3,                            /* Type for SICN*/
  89.     kMenuColorIconType            = 4,                            /* Type for cicn*/
  90.     kMenuIconSuiteType            = 5,                            /* Type for Icon Suite*/
  91.     kMenuIconRefType            = 6                                /* Type for Icon Ref*/
  92. };
  93.  
  94. /* —— end of Appearance 1.0 types*/
  95.  
  96.  
  97. enum {
  98.     noMark                        = 0                                /*mark symbol for MarkItem*/
  99. };
  100.  
  101.  
  102. enum {
  103.                                                                 /* menu defProc messages */
  104.     kMenuDrawMsg                = 0,
  105.     kMenuChooseMsg                = 1,
  106.     kMenuSizeMsg                = 2,
  107.     kMenuDrawItemMsg            = 4,
  108.     kMenuCalcItemMsg            = 5,
  109.     kMenuThemeSavvyMsg            = 7,                            /* is your MDEF theme-savvy?  If so, return hex 7473 in the whichItem parameter*/
  110.     mDrawMsg                    = 0,
  111.     mChooseMsg                    = 1,
  112.     mSizeMsg                    = 2,
  113.     mDrawItemMsg                = 4,
  114.     mCalcItemMsg                = 5
  115. };
  116.  
  117.  
  118. enum {
  119.     kThemeSavvyMenuResponse        = 0x7473
  120. };
  121.  
  122.  
  123. enum {
  124.     textMenuProc                = 0,
  125.     hMenuCmd                    = 27,                            /*itemCmd == 0x001B ==> hierarchical menu*/
  126.     hierMenu                    = -1,                            /*a hierarchical menu - for InsertMenu call*/
  127.     mPopUpMsg                    = 3,                            /*menu defProc messages - place yourself*/
  128.     mctAllItems                    = -98,                            /*search for all Items for the given ID*/
  129.     mctLastIDIndic                = -99                            /*last color table entry has this in ID field*/
  130. };
  131.  
  132.  
  133.  
  134. struct MenuInfo {
  135.     short                             menuID;
  136.     short                             menuWidth;
  137.     short                             menuHeight;
  138.     Handle                             menuProc;
  139.     long                             enableFlags;
  140.     Str255                             menuData;
  141. };
  142. typedef struct MenuInfo                    MenuInfo;
  143.  
  144. typedef MenuInfo *                        MenuPtr;
  145. typedef MenuPtr *                        MenuHandle;
  146. /* MenuRef is obsolete.  Use MenuHandle. */
  147. typedef MenuHandle                         MenuRef;
  148.  
  149. struct MCEntry {
  150.     short                             mctID;                        /*menu ID.  ID = 0 is the menu bar*/
  151.     short                             mctItem;                    /*menu Item. Item = 0 is a title*/
  152.     RGBColor                         mctRGB1;                    /*usage depends on ID and Item*/
  153.     RGBColor                         mctRGB2;                    /*usage depends on ID and Item*/
  154.     RGBColor                         mctRGB3;                    /*usage depends on ID and Item*/
  155.     RGBColor                         mctRGB4;                    /*usage depends on ID and Item*/
  156.     short                             mctReserved;                /*reserved for internal use*/
  157. };
  158. typedef struct MCEntry                    MCEntry;
  159. typedef MCEntry *                        MCEntryPtr;
  160.  
  161. typedef MCEntry                         MCTable[1];
  162. typedef MCEntry *                        MCTablePtr;
  163. typedef MCTablePtr *                    MCTableHandle;
  164.  
  165. struct MenuCRsrc {
  166.     short                             numEntries;                    /*number of entries*/
  167.     MCTable                         mcEntryRecs;                /*ARRAY [1..numEntries] of MCEntry*/
  168. };
  169. typedef struct MenuCRsrc                MenuCRsrc;
  170. typedef MenuCRsrc *                        MenuCRsrcPtr;
  171. typedef MenuCRsrcPtr *                    MenuCRsrcHandle;
  172. #if TARGET_OS_WIN32
  173. /* QuickTime 3.0 */
  174.  
  175. struct MenuAccessKeyRec {
  176.     short                             count;
  177.     long                             flags;
  178.     unsigned char                     keys[1];
  179. };
  180. typedef struct MenuAccessKeyRec            MenuAccessKeyRec;
  181.  
  182. typedef MenuAccessKeyRec *                MenuAccessKeyPtr;
  183. typedef MenuAccessKeyPtr *                MenuAccessKeyHandle;
  184. EXTERN_API( void )
  185. SetMenuItemHotKey                (MenuRef                 menuRef,
  186.                                  short                     itemID,
  187.                                  char                     hotKey,
  188.                                  long                     flags);
  189.  
  190. #endif  /* TARGET_OS_WIN32 */
  191.  
  192. typedef CALLBACK_API( void , MenuDefProcPtr )(short message, MenuHandle theMenu, Rect *menuRect, Point hitPt, short *whichItem);
  193. typedef CALLBACK_API( long , MenuBarDefProcPtr )(short selector, short message, short parameter1, long parameter2);
  194. typedef CALLBACK_API( void , MenuHookProcPtr )(void );
  195. typedef CALLBACK_API( short , MBarHookProcPtr )(Rect *menuRect);
  196. /*
  197.     WARNING: MBarHookProcPtr uses register based parameters under classic 68k
  198.              and cannot be written in a high-level language without 
  199.              the help of mixed mode or assembly glue.
  200. */
  201. typedef STACK_UPP_TYPE(MenuDefProcPtr)                             MenuDefUPP;
  202. typedef STACK_UPP_TYPE(MenuBarDefProcPtr)                         MenuBarDefUPP;
  203. typedef STACK_UPP_TYPE(MenuHookProcPtr)                         MenuHookUPP;
  204. typedef REGISTER_UPP_TYPE(MBarHookProcPtr)                         MBarHookUPP;
  205. enum { uppMenuDefProcInfo = 0x0000FF80 };                         /* pascal no_return_value Func(2_bytes, 4_bytes, 4_bytes, 4_bytes, 4_bytes) */
  206. enum { uppMenuBarDefProcInfo = 0x00003AB0 };                     /* pascal 4_bytes Func(2_bytes, 2_bytes, 2_bytes, 4_bytes) */
  207. enum { uppMenuHookProcInfo = 0x00000000 };                         /* pascal no_return_value Func() */
  208. enum { uppMBarHookProcInfo = 0x000000CF };                         /* SPECIAL_CASE_PROCINFO(12) */
  209. #define NewMenuDefProc(userRoutine)                             (MenuDefUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMenuDefProcInfo, GetCurrentArchitecture())
  210. #define NewMenuBarDefProc(userRoutine)                             (MenuBarDefUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMenuBarDefProcInfo, GetCurrentArchitecture())
  211. #define NewMenuHookProc(userRoutine)                             (MenuHookUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMenuHookProcInfo, GetCurrentArchitecture())
  212. #define NewMBarHookProc(userRoutine)                             (MBarHookUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMBarHookProcInfo, GetCurrentArchitecture())
  213. #define CallMenuDefProc(userRoutine, message, theMenu, menuRect, hitPt, whichItem)  CALL_FIVE_PARAMETER_UPP((userRoutine), uppMenuDefProcInfo, (message), (theMenu), (menuRect), (hitPt), (whichItem))
  214. #define CallMenuBarDefProc(userRoutine, selector, message, parameter1, parameter2)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppMenuBarDefProcInfo, (selector), (message), (parameter1), (parameter2))
  215. #define CallMenuHookProc(userRoutine)                             CALL_ZERO_PARAMETER_UPP((userRoutine), uppMenuHookProcInfo)
  216. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  217.     /* CallMBarHookProc can't be called from classic 68k without glue code */
  218. #else
  219.     #define CallMBarHookProc(userRoutine, menuRect)             CALL_ONE_PARAMETER_UPP((userRoutine), uppMBarHookProcInfo, (menuRect))
  220. #endif
  221.  
  222. EXTERN_API( short )
  223. GetMBarHeight                    (void)                                                        TWOWORDINLINE(0x3EB8, 0x0BAA);
  224.  
  225. EXTERN_API( void )
  226. InitMenus                        (void)                                                        ONEWORDINLINE(0xA930);
  227.  
  228. EXTERN_API( MenuHandle )
  229. NewMenu                            (short                     menuID,
  230.                                  ConstStr255Param         menuTitle)                            ONEWORDINLINE(0xA931);
  231.  
  232. #if TARGET_OS_MAC
  233.     #define MacGetMenu GetMenu
  234. #endif
  235. EXTERN_API( MenuHandle )
  236. MacGetMenu                        (short                     resourceID)                            ONEWORDINLINE(0xA9BF);
  237.  
  238. EXTERN_API( void )
  239. DisposeMenu                        (MenuHandle             theMenu)                            ONEWORDINLINE(0xA932);
  240.  
  241. #if TARGET_OS_MAC
  242.     #define MacAppendMenu AppendMenu
  243. #endif
  244. EXTERN_API( void )
  245. MacAppendMenu                    (MenuHandle             menu,
  246.                                  ConstStr255Param         data)                                ONEWORDINLINE(0xA933);
  247.  
  248. EXTERN_API( void )
  249. InsertResMenu                    (MenuHandle             theMenu,
  250.                                  ResType                 theType,
  251.                                  short                     afterItem)                            ONEWORDINLINE(0xA951);
  252.  
  253. #if TARGET_OS_MAC
  254.     #define MacInsertMenu InsertMenu
  255. #endif
  256. EXTERN_API( void )
  257. MacInsertMenu                    (MenuHandle             theMenu,
  258.                                  short                     beforeID)                            ONEWORDINLINE(0xA935);
  259.  
  260. #if TARGET_OS_MAC
  261.     #define MacDeleteMenu DeleteMenu
  262. #endif
  263. EXTERN_API( void )
  264. MacDeleteMenu                    (short                     menuID)                                ONEWORDINLINE(0xA936);
  265.  
  266. EXTERN_API( void )
  267. AppendResMenu                    (MenuHandle             theMenu,
  268.                                  ResType                 theType)                            ONEWORDINLINE(0xA94D);
  269.  
  270. #if TARGET_OS_MAC
  271.     #define MacInsertMenuItem InsertMenuItem
  272. #endif
  273. EXTERN_API( void )
  274. MacInsertMenuItem                (MenuHandle             theMenu,
  275.                                  ConstStr255Param         itemString,
  276.                                  short                     afterItem)                            ONEWORDINLINE(0xA826);
  277.  
  278. EXTERN_API( void )
  279. DeleteMenuItem                    (MenuHandle             theMenu,
  280.                                  short                     item)                                ONEWORDINLINE(0xA952);
  281.  
  282. EXTERN_API( long )
  283. MenuKey                            (CharParameter             ch)                                    ONEWORDINLINE(0xA93E);
  284.  
  285. EXTERN_API( void )
  286. HiliteMenu                        (short                     menuID)                                ONEWORDINLINE(0xA938);
  287.  
  288. EXTERN_API( void )
  289. SetMenuItemText                    (MenuHandle             theMenu,
  290.                                  short                     item,
  291.                                  ConstStr255Param         itemString)                            ONEWORDINLINE(0xA947);
  292.  
  293. EXTERN_API( void )
  294. GetMenuItemText                    (MenuHandle             theMenu,
  295.                                  short                     item,
  296.                                  Str255                 itemString)                            ONEWORDINLINE(0xA946);
  297.  
  298. EXTERN_API( void )
  299. SetItemMark                        (MenuHandle             theMenu,
  300.                                  short                     item,
  301.                                  CharParameter             markChar)                            ONEWORDINLINE(0xA944);
  302.  
  303. EXTERN_API( void )
  304. GetItemMark                        (MenuHandle             theMenu,
  305.                                  short                     item,
  306.                                  CharParameter *        markChar)                            ONEWORDINLINE(0xA943);
  307.  
  308. EXTERN_API( void )
  309. SetItemCmd                        (MenuHandle             theMenu,
  310.                                  short                     item,
  311.                                  CharParameter             cmdChar)                            ONEWORDINLINE(0xA84F);
  312.  
  313. EXTERN_API( void )
  314. GetItemCmd                        (MenuHandle             theMenu,
  315.                                  short                     item,
  316.                                  CharParameter *        cmdChar)                            ONEWORDINLINE(0xA84E);
  317.  
  318. EXTERN_API( void )
  319. SetItemIcon                        (MenuHandle             theMenu,
  320.                                  short                     item,
  321.                                  short                     iconIndex)                            ONEWORDINLINE(0xA940);
  322.  
  323. EXTERN_API( void )
  324. GetItemIcon                        (MenuHandle             theMenu,
  325.                                  short                     item,
  326.                                  short *                iconIndex)                            ONEWORDINLINE(0xA93F);
  327.  
  328. EXTERN_API( void )
  329. SetItemStyle                    (MenuHandle             theMenu,
  330.                                  short                     item,
  331.                                  StyleParameter         chStyle)                            ONEWORDINLINE(0xA942);
  332.  
  333. EXTERN_API( void )
  334. GetItemStyle                    (MenuHandle             theMenu,
  335.                                  short                     item,
  336.                                  Style *                chStyle);
  337.  
  338. EXTERN_API( MenuHandle )
  339. GetMenuHandle                    (short                     menuID)                                ONEWORDINLINE(0xA949);
  340.  
  341. EXTERN_API( void )
  342. CalcMenuSize                    (MenuHandle             theMenu)                            ONEWORDINLINE(0xA948);
  343.  
  344. EXTERN_API( void )
  345. DisableItem                        (MenuHandle             theMenu,
  346.                                  short                     item)                                ONEWORDINLINE(0xA93A);
  347.  
  348. EXTERN_API( void )
  349. EnableItem                        (MenuHandle             theMenu,
  350.                                  short                     item)                                ONEWORDINLINE(0xA939);
  351.  
  352. EXTERN_API( void )
  353. FlashMenuBar                    (short                     menuID)                                ONEWORDINLINE(0xA94C);
  354.  
  355. EXTERN_API( long )
  356. PopUpMenuSelect                    (MenuHandle             menu,
  357.                                  short                     top,
  358.                                  short                     left,
  359.                                  short                     popUpItem)                            ONEWORDINLINE(0xA80B);
  360.  
  361. EXTERN_API( long )
  362. MenuChoice                        (void)                                                        ONEWORDINLINE(0xAA66);
  363.  
  364. EXTERN_API( void )
  365. DeleteMCEntries                    (short                     menuID,
  366.                                  short                     menuItem)                            ONEWORDINLINE(0xAA60);
  367.  
  368. EXTERN_API( MCTableHandle )
  369. GetMCInfo                        (void)                                                        ONEWORDINLINE(0xAA61);
  370.  
  371. EXTERN_API( void )
  372. SetMCInfo                        (MCTableHandle             menuCTbl)                            ONEWORDINLINE(0xAA62);
  373.  
  374. EXTERN_API( void )
  375. DisposeMCInfo                    (MCTableHandle             menuCTbl)                            ONEWORDINLINE(0xAA63);
  376.  
  377. EXTERN_API( MCEntryPtr )
  378. GetMCEntry                        (short                     menuID,
  379.                                  short                     menuItem)                            ONEWORDINLINE(0xAA64);
  380.  
  381. EXTERN_API( void )
  382. SetMCEntries                    (short                     numEntries,
  383.                                  MCTablePtr             menuCEntries)                        ONEWORDINLINE(0xAA65);
  384.  
  385. #if TARGET_OS_MAC
  386.     #define MacDrawMenuBar DrawMenuBar
  387. #endif
  388. EXTERN_API( void )
  389. MacDrawMenuBar                    (void)                                                        ONEWORDINLINE(0xA937);
  390.  
  391. EXTERN_API( void )
  392. InvalMenuBar                    (void)                                                        ONEWORDINLINE(0xA81D);
  393.  
  394. EXTERN_API( void )
  395. InitProcMenu                    (short                     resID)                                ONEWORDINLINE(0xA808);
  396.  
  397. EXTERN_API( Handle )
  398. GetMenuBar                        (void)                                                        ONEWORDINLINE(0xA93B);
  399.  
  400. EXTERN_API( void )
  401. SetMenuBar                        (Handle                 menuList)                            ONEWORDINLINE(0xA93C);
  402.  
  403. EXTERN_API( Boolean )
  404. SystemEdit                        (short                     editCmd)                            ONEWORDINLINE(0xA9C2);
  405.  
  406. EXTERN_API( void )
  407. SystemMenu                        (long                     menuResult)                            ONEWORDINLINE(0xA9B5);
  408.  
  409. EXTERN_API( Handle )
  410. GetNewMBar                        (short                     menuBarID)                            ONEWORDINLINE(0xA9C0);
  411.  
  412. EXTERN_API( void )
  413. ClearMenuBar                    (void)                                                        ONEWORDINLINE(0xA934);
  414.  
  415. EXTERN_API( void )
  416. CheckItem                        (MenuHandle             theMenu,
  417.                                  short                     item,
  418.                                  Boolean                 checked)                            ONEWORDINLINE(0xA945);
  419.  
  420. EXTERN_API( short )
  421. CountMItems                        (MenuHandle             theMenu)                            ONEWORDINLINE(0xA950);
  422.  
  423. EXTERN_API( void )
  424. SetMenuFlash                    (short                     count)                                ONEWORDINLINE(0xA94A);
  425.  
  426. EXTERN_API( long )
  427. MenuSelect                        (Point                     startPt)                            ONEWORDINLINE(0xA93D);
  428.  
  429. EXTERN_API( void )
  430. InsertFontResMenu                (MenuHandle             theMenu,
  431.                                  short                     afterItem,
  432.                                  short                     scriptFilter)                        THREEWORDINLINE(0x303C, 0x0400, 0xA825);
  433.  
  434. EXTERN_API( void )
  435. InsertIntlResMenu                (MenuHandle             theMenu,
  436.                                  ResType                 theType,
  437.                                  short                     afterItem,
  438.                                  short                     scriptFilter)                        THREEWORDINLINE(0x303C, 0x0601, 0xA825);
  439.  
  440.  
  441. /*——————————————————————————————————————————————————————————————————————————————————————*/
  442. /*    • Appearance 1.0 and later Menu Manager routines                                    */
  443. /*——————————————————————————————————————————————————————————————————————————————————————*/
  444. EXTERN_API( UInt32 )
  445. MenuEvent                        (const EventRecord *    inEvent)                            THREEWORDINLINE(0x303C, 0x020C, 0xA825);
  446.  
  447. EXTERN_API( OSErr )
  448. SetMenuItemCommandID            (MenuHandle             inMenu,
  449.                                  SInt16                 inItem,
  450.                                  UInt32                 inCommandID)                        THREEWORDINLINE(0x303C, 0x0502, 0xA825);
  451.  
  452. EXTERN_API( OSErr )
  453. GetMenuItemCommandID            (MenuHandle             inMenu,
  454.                                  SInt16                 inItem,
  455.                                  UInt32 *                outCommandID)                        THREEWORDINLINE(0x303C, 0x0503, 0xA825);
  456.  
  457. EXTERN_API( OSErr )
  458. SetMenuItemModifiers            (MenuHandle             inMenu,
  459.                                  SInt16                 inItem,
  460.                                  UInt8                     inModifiers)                        THREEWORDINLINE(0x303C, 0x0404, 0xA825);
  461.  
  462. EXTERN_API( OSErr )
  463. GetMenuItemModifiers            (MenuHandle             inMenu,
  464.                                  SInt16                 inItem,
  465.                                  UInt8 *                outModifiers)                        THREEWORDINLINE(0x303C, 0x0505, 0xA825);
  466.  
  467. EXTERN_API( OSErr )
  468. SetMenuItemIconHandle            (MenuHandle             inMenu,
  469.                                  SInt16                 inItem,
  470.                                  UInt8                     inIconType,
  471.                                  Handle                 inIconHandle)                        THREEWORDINLINE(0x303C, 0x0606, 0xA825);
  472.  
  473. EXTERN_API( OSErr )
  474. GetMenuItemIconHandle            (MenuHandle             inMenu,
  475.                                  SInt16                 inItem,
  476.                                  UInt8 *                outIconType,
  477.                                  Handle *                outIconHandle)                        THREEWORDINLINE(0x303C, 0x0707, 0xA825);
  478.  
  479. EXTERN_API( OSErr )
  480. SetMenuItemTextEncoding            (MenuHandle             inMenu,
  481.                                  SInt16                 inItem,
  482.                                  TextEncoding             inScriptID)                            THREEWORDINLINE(0x303C, 0x0408, 0xA825);
  483.  
  484. EXTERN_API( OSErr )
  485. GetMenuItemTextEncoding            (MenuHandle             inMenu,
  486.                                  SInt16                 inItem,
  487.                                  TextEncoding *            outScriptID)                        THREEWORDINLINE(0x303C, 0x0509, 0xA825);
  488.  
  489. EXTERN_API( OSErr )
  490. SetMenuItemHierarchicalID        (MenuHandle             inMenu,
  491.                                  SInt16                 inItem,
  492.                                  SInt16                 inHierID)                            THREEWORDINLINE(0x303C, 0x040D, 0xA825);
  493.  
  494. EXTERN_API( OSErr )
  495. GetMenuItemHierarchicalID        (MenuHandle             inMenu,
  496.                                  SInt16                 inItem,
  497.                                  SInt16 *                outHierID)                            THREEWORDINLINE(0x303C, 0x050E, 0xA825);
  498.  
  499. EXTERN_API( OSErr )
  500. SetMenuItemFontID                (MenuHandle             inMenu,
  501.                                  SInt16                 inItem,
  502.                                  SInt16                 inFontID)                            THREEWORDINLINE(0x303C, 0x040F, 0xA825);
  503.  
  504. EXTERN_API( OSErr )
  505. GetMenuItemFontID                (MenuHandle             inMenu,
  506.                                  SInt16                 inItem,
  507.                                  SInt16 *                outFontID)                            THREEWORDINLINE(0x303C, 0x0510, 0xA825);
  508.  
  509. EXTERN_API( OSErr )
  510. SetMenuItemRefCon                (MenuHandle             inMenu,
  511.                                  SInt16                 inItem,
  512.                                  UInt32                 inRefCon)                            THREEWORDINLINE(0x303C, 0x050A, 0xA825);
  513.  
  514. EXTERN_API( OSErr )
  515. GetMenuItemRefCon                (MenuHandle             inMenu,
  516.                                  SInt16                 inItem,
  517.                                  UInt32 *                outRefCon)                            THREEWORDINLINE(0x303C, 0x050B, 0xA825);
  518.  
  519. EXTERN_API( OSErr )
  520. SetMenuItemRefCon2                (MenuHandle             inMenu,
  521.                                  SInt16                 inItem,
  522.                                  UInt32                 inRefCon2)                            THREEWORDINLINE(0x303C, 0x0511, 0xA825);
  523.  
  524. EXTERN_API( OSErr )
  525. GetMenuItemRefCon2                (MenuHandle             inMenu,
  526.                                  SInt16                 inItem,
  527.                                  UInt32 *                outRefCon2)                            THREEWORDINLINE(0x303C, 0x0512, 0xA825);
  528.  
  529. EXTERN_API( OSErr )
  530. SetMenuItemKeyGlyph                (MenuHandle             inMenu,
  531.                                  SInt16                 inItem,
  532.                                  SInt16                 inGlyph)                            THREEWORDINLINE(0x303C, 0x0513, 0xA825);
  533.  
  534. EXTERN_API( OSErr )
  535. GetMenuItemKeyGlyph                (MenuHandle             inMenu,
  536.                                  SInt16                 inItem,
  537.                                  SInt16 *                outGlyph)                            THREEWORDINLINE(0x303C, 0x0514, 0xA825);
  538.  
  539. /*——————————————————————————————————————————————————————————————————————————————————————*/
  540. /*    • Contextual Menu routines and constants                                            */
  541. /*    available with Conxtextual Menu extension 1.0 and later                                */
  542. /*——————————————————————————————————————————————————————————————————————————————————————*/
  543. /* Gestalt Selector for classic 68K apps only. */
  544. /* CFM apps should weak link and check the symbols. */
  545.  
  546. enum {
  547.     gestaltContextualMenuAttr    = FOUR_CHAR_CODE('cmnu'),
  548.     gestaltContextualMenuUnusedBit = 0,
  549.     gestaltContextualMenuTrapAvailable = 1
  550. };
  551.  
  552. /* Values indicating what kind of help the application supports */
  553.  
  554. enum {
  555.     kCMHelpItemNoHelp            = 0,
  556.     kCMHelpItemAppleGuide        = 1,
  557.     kCMHelpItemOtherHelp        = 2
  558. };
  559.  
  560. /* Values indicating what was chosen from the menu */
  561.  
  562. enum {
  563.     kCMNothingSelected            = 0,
  564.     kCMMenuItemSelected            = 1,
  565.     kCMShowHelpSelected            = 3
  566. };
  567.  
  568. EXTERN_API( OSStatus )
  569. InitContextualMenus                (void)                                                        TWOWORDINLINE(0x7001, 0xAA72);
  570.  
  571. EXTERN_API( Boolean )
  572. IsShowContextualMenuClick        (const EventRecord *    inEvent)                            TWOWORDINLINE(0x7002, 0xAA72);
  573.  
  574. EXTERN_API( OSStatus )
  575. ContextualMenuSelect            (MenuHandle             inMenu,
  576.                                  Point                     inGlobalLocation,
  577.                                  Boolean                 inReserved,
  578.                                  UInt32                 inHelpType,
  579.                                  ConstStr255Param         inHelpItemString,
  580.                                  const AEDesc *            inSelection,
  581.                                  UInt32 *                outUserSelectionType,
  582.                                  SInt16 *                outMenuID,
  583.                                  UInt16 *                outMenuItem)                        TWOWORDINLINE(0x7003, 0xAA72);
  584.  
  585. EXTERN_API( Boolean )
  586. ProcessIsContextualMenuClient    (ProcessSerialNumber *    inPSN)                                TWOWORDINLINE(0x7004, 0xAA72);
  587.  
  588.  
  589.  
  590.  
  591. /* 
  592.     CheckItem, CountMItems, and SetMenuFlash should have better names.
  593.     But the shipping InterfaceLib has the old names, so we need
  594.     to define the new and old names and use macros to map the 
  595.     new names to old names for linking with InterfaceLib.
  596. */
  597. #if TARGET_OS_MAC
  598.     #define CheckMenuItem MacCheckMenuItem
  599. #endif
  600. #define MacCheckMenuItem( menu, item, checked ) CheckItem( menu, item, checked )
  601. #define CountMenuItems( menu )                     CountMItems( menu )
  602. #define SetMenuFlashCount( count )                 SetMenuFlash( count )
  603.  
  604.  
  605. #if CGLUESUPPORTED
  606. EXTERN_API_C( MenuHandle )
  607. newmenu                            (short                     menuID,
  608.                                  const char *            menuTitle);
  609.  
  610. EXTERN_API_C( void )
  611. appendmenu                        (MenuHandle             menu,
  612.                                  const char *            data);
  613.  
  614. EXTERN_API_C( void )
  615. insertmenuitem                    (MenuHandle             theMenu,
  616.                                  const char *            itemString,
  617.                                  short                     afterItem);
  618.  
  619. EXTERN_API_C( long )
  620. menuselect                        (const Point *            startPt);
  621.  
  622. EXTERN_API_C( void )
  623. setmenuitemtext                    (MenuHandle             menu,
  624.                                  short                     item,
  625.                                  const char *            itemString);
  626.  
  627. EXTERN_API_C( void )
  628. getmenuitemtext                    (MenuHandle             menu,
  629.                                  short                     item,
  630.                                  char *                    itemString);
  631.  
  632. #endif  /* CGLUESUPPORTED */
  633.  
  634. #if OLDROUTINENAMES
  635. #define AddResMenu(theMenu, theType) AppendResMenu(theMenu, theType)
  636. #define InsMenuItem(theMenu, itemString, afterItem)    InsertMenuItem(theMenu, itemString, afterItem)
  637. #define DelMenuItem( theMenu, item ) DeleteMenuItem( theMenu, item )
  638. #if TARGET_OS_MAC
  639. #define SetItem MacSetItem
  640. #define GetItem MacGetItem
  641. #endif
  642. #define MacSetItem(theMenu, item, itemString) SetMenuItemText(theMenu, item, itemString)
  643. #define MacGetItem(theMenu, item, itemString) GetMenuItemText(theMenu, item, itemString)
  644. #define GetMHandle(menuID) GetMenuHandle(menuID)
  645. #define DelMCEntries(menuID, menuItem) DeleteMCEntries(menuID, menuItem)
  646. #define DispMCInfo(menuCTbl) DisposeMCInfo(menuCTbl)
  647. #if CGLUESUPPORTED
  648. #define addresmenu(menu, data) appendresmenu(menu, data)
  649. #define getitem(menu, item, itemString) getmenuitemtext(menu, item, itemString)
  650. #define setitem(menu, item, itemString) setmenuitemtext(menu, item, itemString)
  651. #define insmenuitem(theMenu, itemString, afterItem)    insertmenuitem(theMenu, itemString, afterItem)
  652. #endif    /* CGLUESUPPORTED */
  653. #endif  /* OLDROUTINENAMES */
  654.  
  655.  
  656.  
  657. #if TARGET_OS_WIN32
  658. #endif  /* TARGET_OS_WIN32 */
  659.  
  660.  
  661. #if PRAGMA_STRUCT_ALIGN
  662.     #pragma options align=reset
  663. #elif PRAGMA_STRUCT_PACKPUSH
  664.     #pragma pack(pop)
  665. #elif PRAGMA_STRUCT_PACK
  666.     #pragma pack()
  667. #endif
  668.  
  669. #ifdef PRAGMA_IMPORT_OFF
  670. #pragma import off
  671. #elif PRAGMA_IMPORT
  672. #pragma import reset
  673. #endif
  674.  
  675. #ifdef __cplusplus
  676. }
  677. #endif
  678.  
  679. #endif /* __MENUS__ */
  680.  
  681.